﻿
using Microsoft.EntityFrameworkCore;
using FreeRedis;
using Newtonsoft.Json;
using Microsoft.AspNetCore.Mvc;
using static System.Reflection.Metadata.BlobBuilder;
using Newtonsoft.Json.Linq;
using CQIE.LabAssist.Models;
using System;
using CQIE.LabAssist.PublicHelp;
using System.Drawing;
namespace CQIE.LabAssist.DataAccesss
{

    public class FirstService : IFirstService
    {


        private readonly _DbContext _Db;
        private readonly JwtHelp _jwtHelper;
      
    
        public FirstService(JwtHelp jwtHelper,_DbContext db)
        {
             _jwtHelper = jwtHelper;
            _Db = db;
        }
        public JsonResult getAllCheckByfalse()
        {
            var res=_Db.Checks.Where(W=>W.State==false).Include(w=>w.laboratory).ToList().Select( g=>new
            {
                Id=g.Id,
                Name=g.laboratory.Name,
                Time=g.DateTime.ToString(),
                Reason="异常"
            });
            return new JsonResult(res);
        }
    }

    
}
